<%@ page language="java" import="web_hr.Model,java.util.*,java.sql.*"  contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <% 
   //  String password = new String(request.getParameter("password").getBytes("ISO-8859-1"),"UTF-8");
    String  username=(String) request.getSession().getAttribute("username");
    String pass=new String(request.getParameter("password").getBytes("ISO-8859-1"),"UTF-8");
     Model m=new Model("hr_employee");
	 ResultSet rs=m.eQuery("select password from hr_employee where username='"+username+"'");
	//取出数据库中原密码，判断是否正确。
		if(rs!=null){
			rs.next();
			String password =rs.getString("password");
			if (!(password.equals(pass)))
			out.println("<span id='w1'><font color = red>Sorry,Old password  is not correct</font></span>");
			else 
				out.println("<span id='w1'><font color = green>Correct</font></span>");
			}
			
 
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>

</body>
</html>